package com.cskaoyan.javase.oop2._1extends._9override._3exercise;

/**
 * 读程序题
 * @since 10:59
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        /*
            一 100 200 200
            二 100 200 200
            三 100 100 200
            四 100 200 100
         */
        // 100
        /*Father f = new Father();
        Son s = new Son();
        Father fs = new Son();*/
        Father f = new Father();
        Son s = new Son(300);
        Father fs = new Son(400);
    }
}

class Father {
    int num = 100;
    public int getNum() {
        return num;
    }
    public Father() {
        System.out.println(getNum());
    }
}

class Son extends Father {
    int num = 200;
    {
        num = 300;
    }
    @Override
    public int getNum() {
        return num;
    }

    public Son() {
        // super();
    }

    public Son(int num) {
        this.num = num;
    }
}